/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ania2;

import ania2.enums.Fields;

/**
 *
 * @author pawel
 */
public class Move {
    
    private BoardPosition position;
    private Fields sourceField;
    private Fields targetField;
    private String notation;
    private String shortNotation;
    private boolean promotion;
    private int value;

    public Move(BoardPosition position, Fields sourceField, Fields targetFields) {
        this.position = position;
        this.sourceField = sourceField;
        this.targetField = targetFields;
        this.notation = null;
        this.shortNotation = null;
    }
    
    @Override
    public String toString() {
        return this.shortNotation;
    }

    public Move(BoardPosition position, Fields sourceField, Fields targetField, String notation, String shortNotation, boolean promotion) {
        this.position = position;
        this.sourceField = sourceField;
        this.targetField = targetField;
        this.notation = notation;
        this.shortNotation = shortNotation;
        this.promotion = promotion;
    }

    public String getNotation() {
        return notation;
    }

    public void setNotation(String notation) {
        this.notation = notation;
    }

    public BoardPosition getPosition() {
        return position;
    }

    public void setPosition(BoardPosition position) {
        this.position = position;
    }

    public boolean isPromotion() {
        return promotion;
    }

    public void setPromotion(boolean promotion) {
        this.promotion = promotion;
    }

    public String getShortNotation() {
        return shortNotation;
    }

    public void setShortNotation(String shortNotation) {
        this.shortNotation = shortNotation;
    }

    public Fields getSourceField() {
        return sourceField;
    }

    public void setSourceField(Fields sourceField) {
        this.sourceField = sourceField;
    }

    public Fields getTargetField() {
        return targetField;
    }

    public void setTargetField(Fields targetField) {
        this.targetField = targetField;
    }

    @Override
    public boolean equals(Object obj) {
        if(obj instanceof Move) {
            Move m = (Move)obj;
            if(this.notation.equals(m.getNotation()))
                return true;
        }
        return false;
    }

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }
    
    

}
